﻿@using FCTC_Web.Models
@using DAL
@model FCTC_Web.Utilities.Page<VehicleEstimation>
@{
    ViewBag.Title = "Index";
    int current = 0;
    string styletr = "";
}
<h2>
    评估预约列表</h2>
<style>
table tr th{ padding:0px 20px;text-align:center; line-height:30px }
table tr td{ text-align:center;}
</style>
<table width="100%">
    <tr>
        <th>
            评估师
        </th>
        <th>
            车名
        </th>
        <th>
            品牌
        </th>
        <th>
            型号
        </th>
        <th>
            排量
        </th>
        <th>
            预约人
        </th>
        <th>
            联系方式
        </th>
        <th>
            状态
        </th>
        <th>
            操作
        </th>
    </tr>
    @foreach (var item in Model.CurrentRecords)
    {
        if (current % 2 == 1) { styletr = "background-color:#f6fdfd"; }
        else if (current % 2 == 0) { styletr = ""; }
        <tr style="@styletr">
            <td>
              @if (item.Estimator != null)
                {
                    @Html.DisplayFor(modelItem => item.Estimator.Personal.FullName)
                }
                else
                {
                    Html.Display("无");
                }
               
            </td>
            <td>
               @Html.DisplayFor(modelItem => item.Vehicle.FullName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Vehicle.CarBrand)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Vehicle.BrandType)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Vehicle.DeliveryCapacity)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Personal.FullName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Personal.Contact)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AppointmentStatus)
            </td>
            <td>
                @Html.ActionLink("编辑", "Edit", new { id = item.ID }) |
                @Html.ActionLink("细节", "Details", new { id = item.ID }) |
                @Html.ActionLink("删除", "Delete", new { id = item.ID })
            </td>
        </tr>
        current++;
    }
</table>
@Html.Pager(Model, "/AppointmentMaintain/Index")